package com.design.simplefactory.demo;

/**
 * @Author: xiemiao
 * @CreateTime: 2023-04-19  22:43
 * @Description: TODO
 * @Version: 1.0
 */
public class Factory {
    public static Product getProduct(String arg) {
        Product product = null;

        if (arg.equalsIgnoreCase("A")) {
            product = new ConcreteProductA();
        } else if (arg.equalsIgnoreCase("B")) {
            product = new ConcreteProductB();
        }
        return product;
    }
}
